package com.ljs.feign;

import com.ljs.entity.Menu;
import com.ljs.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
@FeignClient(value = "userprovider" ,fallback = UserError.class)
public interface UserFeign {
    @GetMapping("/user/findall/{index}/{limit}")
    public List<User> selAll(@PathVariable("index") int index, @PathVariable("limit") int limit);

    @GetMapping("/user/name/{na}")

    public   List<User> selbyname(@PathVariable("na") String name);
    @GetMapping("/user/index")
    public String selport();
    @GetMapping("/user/all")
    public   List<User> all();
    @GetMapping("/user/count")

    public int count();
    @GetMapping("/user/delete/{id}")
    public  boolean delete(@PathVariable("id") int id);
    @GetMapping("/user/save")
    public  boolean save(@RequestBody User user);

    @GetMapping("/user/update")
    public  boolean update(@RequestBody User user);
    @GetMapping("/user/upd/{id}")
    public User seluserbyid(@PathVariable("id") int id);
}
